package com.sakiko.dailynote.annotations;

import com.sakiko.dailynote.validations.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented
@Target({ ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Constraint(
        validatedBy = { StateValidation.class }
)
// 自定义注解类
public @interface State {
    // 提供校验失败后的提示信息
    String message() default "state参数的值，只能是【已发布】或者【草稿】";// default: {jakarta.validation.constraints.NotEmpty.message}
    // 指定分组
    Class<?>[] groups() default {};
    // 负载 获取到 state注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
